Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
country-state-city-nextjs
Advanced tools
This is a library for get all countrys, states and citys of world.
Using npm:
npm i country-state-city-nextjs
import {
load,
countryProps,
stateProps,
cityProps,
useCSCProps,
loadCountrys,
loadStates,
loadCitys,
useCSC,
} from "country-state-city-nextjs/cjs/index";
const [CSC, setCSC] = useState<{
countrys: countryProps[];
states: stateProps[];
citys: cityProps[];
}>({
countrys: [],
states: [],
citys: [],
});
const loadCSC = async () => {
const countrys: countryProps[] = await loadCountrys();
const states: stateProps[] = await loadStates();
const citys: cityProps[] = await loadCitys();
setCSC({
countrys,
states,
citys,
});
};
useEffect(() => {
loadCSC();
}, []);
const {
load, //is load all countrys, states and citys
countrySelected, //current country selected
stateSelected, //current state selected
citySelected, //current city selected
countrys, //all countrys
states, //all states
citys, //all citys
onChangeCSC, //object of functions for change selected country, state and city
statesForCountrySelected // all states of countrySelected
citysForStateSelected // all citys of stateSelected
} = useCSC({
//(Optional)
defaultCountry: {
id: 82,
text: "Colombia",
},
//(Optional)
defaultState: {
id: 1700,
id_country: 82,
text: "Antioquia",
},
//(Optional)
defaultCity: {
id: 465167,
id_state: 1700,
text: "Medellín",
},
});
// change country; state and city change to null
onChangeCSC.country({
id: 95,
text: "Venezuela",
});
// change state; city change to null
// if countrySelected is null onChangeCSC.state not change state
onChangeCSC.state({
id: 1861,
id_country: 95,
text: "Táchira",
});
// change city
// if stateSelected is null onChangeCSC.city not change city
onChangeCSC.city({
id: 590202,
id_state: 1861,
text: "Peracal",
});
Email blancofrancisco34@gmail.com
FAQs
Get all countrys, states and citys of world
The npm package country-state-city-nextjs receives a total of 151 weekly downloads. As such, country-state-city-nextjs popularity was classified as not popular.
We found that country-state-city-nextjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.